package com.ityedao.递归;

public class MonkeyCase {
    // f(10) = 1
    // f(x) - f(x)/2 - 1 = f(x+1)
    // f(x) = 2f(x+1) + 2

    public static void main(String[] args) {
        System.out.println(f(1));
        System.out.println(f(2));
    }

    private static int f(int x) {
        if (x == 10){
            return 1;
        }else {
            return 2 * f(x+1) + 2;
        }
    }

}
